<?php
//check1
namespace Home\Controller;
use Think\Controller;
use Think\Model;

class MyhomepageController extends Controller {
    public function index(){
    	if(session('?user')){
    		$this->assign('user',I('session.user'));
    		$reserve = M('Abasics');
    		$data1['email'] = I('session.user');
    		$result1=$reserve
    		->join('brilliance_university ON brilliance_abasics.university = brilliance_university.u_num')
    		->where($data1)->select();
    		$result2=$reserve
    		->join('brilliance_currency ON brilliance_abasics.currency = brilliance_currency.c_num')
    		->where($data1)->select();
    		if($result1&&$result2){
    			$this->assign('data', $result1[0]);
    			$this->assign('data2', $result2[0]);
    			$this->assign('no_reserve','');   			
    		}
    		else{  			
   				$this->assign('no_reserve','您没有任何申请');
    		}
    		$this->display();
    	}
    	else{
    		redirect(U('Login/index'));
    	}
    }
}